package com.itheima.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author robin
 * @version 1.0
 * WebMvcConfigurationSupport： 对springmvc底层很多配置进行封装
 */
@Configuration
@ComponentScan("com.itheima.controller")
public class SpringmvcConfig extends WebMvcConfigurationSupport {
    /**
     * 对请求的静态资源放行
     *
     * @param registry
     */
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        //对静态资源放行，对静态资源不做映射处理
        registry.addResourceHandler("/**").addResourceLocations("/");
        super.addResourceHandlers(registry);
    }
}
